@REM Make main package

if "%1" == "" goto :END

setlocal
set NS=EAT
set DEST=..\binaries
set SYMDEST=..\symbols
set SRC=%1

@REM Copy the DLLs to the %DEST% directory

if NOT EXIST %DEST% mkdir %DEST%
if EXIST %DEST%\%NS%.Common.dll del %DEST%\%NS%.Common.dll
if EXIST %DEST%\%NS%.ConfigurationUtility.dll del %DEST%\%NS%.ConfigurationUtility.dll
if EXIST %DEST%\%NS%.CreateSiteCollection.dll del %DEST%\%NS%.CreateSiteCollection.dll
if EXIST %DEST%\%NS%.ExternalCollaboration.dll del %DEST%\%NS%.ExternalCollaboration.dll
if EXIST %DEST%\%NS%.ExternalUserApproval.dll del %DEST%\%NS%.ExternalUserApproval.dll
if EXIST %DEST%\%NS%.SiteCollectionApproval.dll del %DEST%\%NS%.SiteCollectionApproval.dll
if EXIST %DEST%\%NS%.SiteCollectionManager.dll del %DEST%\%NS%.SiteCollectionManager.dll
if EXIST %DEST%\%NS%.UserManager.dll del %DEST%\%NS%.UserManager.dll

copy ..\Common\Common\%SRC%%NS%.Common.dll %DEST%\%NS%.Common.dll
copy ..\ConfigurationUtility\ConfigurationUtility\%SRC%%NS%.ConfigurationUtility.dll %DEST%\%NS%.ConfigurationUtility.dll
copy ..\CreateSiteCollection\CreateSiteCollection\%SRC%%NS%.CreateSiteCollection.dll %DEST%\%NS%.CreateSiteCollection.dll
copy ..\ExternalCollaboration\ExternalCollaboration\%SRC%%NS%.ExternalCollaboration.dll %DEST%\%NS%.ExternalCollaboration.dll
copy ..\ExternalUserApproval\ExternalUserApproval\%SRC%%NS%.ExternalUserApproval.dll %DEST%\%NS%.ExternalUserApproval.dll
copy ..\SiteCollectionApproval\SiteCollectionApproval\%SRC%%NS%.SiteCollectionApproval.dll %DEST%\%NS%.SiteCollectionApproval.dll
copy ..\SiteCollectionManager\SiteCollectionManager\%SRC%%NS%.SiteCollectionManager.dll %DEST%\%NS%.SiteCollectionManager.dll
copy ..\UserManager\UserManager\%SRC%%NS%.UserManager.dll %DEST%\%NS%.UserManager.dll

@REM Copy the symbol files to the %SYMDEST% directory

if NOT EXIST %SYMDEST% mkdir %SYMDEST%
if EXIST %SYMDEST%\%NS%.Common.pdb del %SYMDEST%\%NS%.Common.pdb
if EXIST %SYMDEST%\%NS%.ConfigurationUtility.pdb del %SYMDEST%\%NS%.ConfigurationUtility.pdb
if EXIST %SYMDEST%\%NS%.CreateSiteCollection.pdb del %SYMDEST%\%NS%.CreateSiteCollection.pdb
if EXIST %SYMDEST%\%NS%.ExternalCollaboration.pdb del %SYMDEST%\%NS%.ExternalCollaboration.pdb
if EXIST %SYMDEST%\%NS%.ExternalUserApproval.pdb del %SYMDEST%\%NS%.ExternalUserApproval.pdb
if EXIST %SYMDEST%\%NS%.SiteCollectionApproval.pdb del %SYMDEST%\%NS%.SiteCollectionApproval.pdb
if EXIST %SYMDEST%\%NS%.SiteCollectionManager.pdb del %SYMDEST%\%NS%.SiteCollectionManager.pdb
if EXIST %SYMDEST%\%NS%.UserManager.pdb del %SYMDEST%\%NS%.UserManager.pdb

copy ..\Common\Common\%SRC%%NS%.Common.pdb %SYMDEST%\%NS%.Common.pdb
copy ..\ConfigurationUtility\ConfigurationUtility\%SRC%%NS%.ConfigurationUtility.pdb %SYMDEST%\%NS%.ConfigurationUtility.pdb
copy ..\CreateSiteCollection\CreateSiteCollection\%SRC%%NS%.CreateSiteCollection.pdb %SYMDEST%\%NS%.CreateSiteCollection.pdb
copy ..\ExternalCollaboration\ExternalCollaboration\%SRC%%NS%.ExternalCollaboration.pdb %SYMDEST%\%NS%.ExternalCollaboration.pdb
copy ..\ExternalUserApproval\ExternalUserApproval\%SRC%%NS%.ExternalUserApproval.pdb %SYMDEST%\%NS%.ExternalUserApproval.pdb
copy ..\SiteCollectionApproval\SiteCollectionApproval\%SRC%%NS%.SiteCollectionApproval.pdb %SYMDEST%\%NS%.SiteCollectionApproval.pdb
copy ..\SiteCollectionManager\SiteCollectionManager\%SRC%%NS%.SiteCollectionManager.pdb %SYMDEST%\%NS%.SiteCollectionManager.pdb
copy ..\UserManager\UserManager\%SRC%%NS%.UserManager.pdb %SYMDEST%\%NS%.UserManager.pdb

@REM Package the solution

.\package.cmd

:END
